package com.baizhi.service.impl;

import com.baizhi.entity.Category;
import com.baizhi.mapper.CategoryMapper;
import com.baizhi.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CategoryServiceimpl implements CategoryService {
    @Autowired
    private CategoryMapper categoryMapper;

    @Override
    public int insertCategory(Category category) {
        return categoryMapper.insertCategory(category);
    }

    @Override
    public int deleteCategory(int id) {
        return categoryMapper.deleteCategory(id);
    }

    @Override
    public List<Category> selectCategorysByPage(int offset, int rows) {
        return categoryMapper.selectCategorysByPage((offset - 1) * rows, rows);
    }

    @Override
    public int selectToalCount() {
        return categoryMapper.selectToalCount();

    }
}
